jQuery.divselect = function(divselectid,inputselectid) {
    $( document.body ).on( "click", divselectid + " cite", function ( e ) {
		$(".divselect").css("z-index","9");
		$(divselectid+" ul").hide();
		var select_min = $(this).next("ul").height();
		var ul = $(this).siblings("ul");
		if(ul.css("display")=="none"){
			ul.slideDown("fast");
		}else{
			ul.slideUp("fast");
		}
		$(this).parent().css("z-index","11");
		if($(this).next("ul").hasClass("divselect_minH")){
			if(select_min > 200){
				$(this).next("ul").addClass("divselect_minH_over");
				}
			}
		return false;
	});
    $( document.body ).on( "click", divselectid + " ul li a", function ( e ) {
		var txt = $(this).text();
		$(this).parent().parent().siblings("cite").html(txt);
		var value = $(this).attr("selectid");
		$(this).parent().parent().parent().siblings(inputselectid).val(value);
		$(divselectid+" ul").hide();
		$(divselectid+" ul").removeClass("divselect_minH_over");
		$(this).parent().parent().parent().css("z-index","9");
	});
	$(document).click(function(){
		$(divselectid+" ul").hide();
		$(divselectid).css("z-index","9");
	});
};



